//
//  LEOLoginView.swift
//  SinaWeibo
//
//  Created by 李子海LEO on 4/6/16.
//  Copyright © 2016 李子海LEO. All rights reserved.
//

import UIKit

import SnapKit

class LEOLoginView: UIView {
    
    
    override init(frame: CGRect) {
        
        super.init(frame: frame)
        
        self.backgroundColor=UIColor.whiteColor()
        
        seUpUi()
        
    
        
    }
    
    //约束布局,最终会在这个方法中,根据我们设置的布局来设置 frame
//    override func layoutSubviews() {
//        
//    }
    
    private func seUpUi(){

        addSubview(loginButton)
        
        addSubview(imageView)
        
        addSubview(signUpButton)
        
        loginButton.snp_makeConstraints { (make) in
            
            
            make.centerX.equalTo(self.snp_centerX).offset(-90)
            
            make.centerY.equalTo(self.snp_centerY).offset(50)
            

        }
        
        imageView.snp_makeConstraints { (make)->Void in
            
            make.centerX.equalTo(self.snp_centerX)
            
            make.centerY.equalTo(self.snp_centerY).offset(-60)
            
        }
        
        signUpButton.snp_makeConstraints { (make) in
            
            make.centerX.equalTo(self.snp_centerX).offset(90)
            
            make.centerY.equalTo(self.snp_centerY).offset(50)
        }
        

    
    }
    
    required init?(coder aDecoder: NSCoder) {
        
        fatalError("init(coder:) has not been implemented")
        
    }
    
    private lazy var imageView=UIImageView.init(image: UIImage.init(named: "visitordiscover_feed_image_smallicon"))
    
    private lazy var imageView2=UIImageView.init(image: UIImage.init(named: "visitordiscover_feed_image_house"))
    
    
    private lazy var loginButton={()->UIButton in
        
        let loginButton=UIButton()
        
        loginButton.setTitle("登  录", forState: .Normal)
        
        loginButton.setTitleColor(UIColor.blackColor(), forState: .Normal)

        loginButton.setBackgroundImage(UIImage.init(named: "common_button_white_disable"), forState: .Normal)
        
        loginButton.titleLabel?.textAlignment=NSTextAlignment.Center
        
        return loginButton
        
    }()
    
    private lazy var signUpButton={()->UIButton in
        
        let signUpButton = UIButton()
        
        signUpButton.setTitle("注  册", forState: .Normal)
        
        signUpButton.setTitleColor(UIColor.blackColor(), forState: .Normal)
        
        signUpButton.setBackgroundImage(UIImage.init(named: "common_button_white_disable"), forState: .Normal)
        
        signUpButton.titleLabel?.textAlignment=NSTextAlignment.Center
        
        return signUpButton

    }()
    
    
}
